package zuk.clipvietfun.home;


import java.util.List;

import zuk.clipvietfun.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;


public class HomeAdapter extends ArrayAdapter<HomeItem>{
	List<HomeItem> homeitems;
	public HomeAdapter(Context context, int textViewResourceId, List<HomeItem> myListItems) {
		super(context, textViewResourceId, myListItems);
		this.homeitems = myListItems;
	}

	public View getView(final int position, View convertView, ViewGroup parent) {
		View v = convertView;
		if (v == null) {
			LayoutInflater infalInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = infalInflater.inflate(R.layout.homeitems, null);
		}
		final HomeItem item = homeitems.get(position);
		TextView text = (TextView)v.findViewById(R.id.homeitems_text);
		text.setText(item.catag);
		
		return v;
	}
	
}
